package com.ngant.maskbitmapexample;

import android.os.Bundle;
import android.app.Activity;
import android.graphics.Bitmap;
import android.graphics.BitmapFactory;
import android.graphics.Color;
import android.graphics.drawable.BitmapDrawable;
import android.util.Log;
import android.view.Menu;
import android.view.MenuItem;
import android.view.MotionEvent;
import android.widget.ImageView;
import android.support.v4.app.NavUtils;

public class MainActivity extends Activity {

    @Override
    public void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_main);
        
        ImageView img = (ImageView) findViewById(R.id.imageView1);
        
        Bitmap src =BitmapFactory.decodeResource(getResources(), R.drawable.beautifulgirl);
        Bitmap vespa =BitmapFactory.decodeResource(getResources(), R.drawable.vespa_go);
        //Bitmap bm= RoundedCorner.getRoundedCornerBitmap(BitmapFactory.decodeResource(getResources(), R.drawable.beautifulgirl));
        
        Bitmap bm= RoundedCorner.toTransparency(vespa, Color.BLUE, true, src);
        img.setImageBitmap(bm);
    }

    @Override
    public boolean onCreateOptionsMenu(Menu menu) {
        
        return true;
    }

    @Override
    public boolean onTouchEvent(MotionEvent event) {
    	if(event.getAction() == MotionEvent.ACTION_DOWN)
    	{
    		Log.d("aaaa", "down");
    	}
    	else if(event.getAction() == MotionEvent.ACTION_MOVE)
    	{
    		Log.d("aaaa", "move");
    	}
    	else if(event.getAction() == MotionEvent.ACTION_UP)
    	{
    		Log.d("aaaa", "up");
    	}
    	
    	return true;
    }
}
